package designpattern.proxy.impl;

import org.apache.log4j.Logger;

/**
 * @author 吴阳基
 * @datetime 2024/1/6 9:41
 */
public class IntermediarySubclass extends RealBuyer{
    private Logger logger = Logger.getLogger(IntermediarySubclass.class);

    /**
     * 重写目标对象的方法，增加一些额外的功能
     * @return
     */
    @Override
    public String havealook() {
        before();
        //执行目标对象的实际业务
        String feedback = super.havealook();
        after();
        return "看房记录：买家反馈" + feedback;

    }
    private void before(){
        logger.info("买家进入看房记录");
    }
    private void after(){
        logger.info("买家离开看房记录");
    }
}
